package com.qf.springbootproject.wechat;

import com.qf.springbootproject.utils.ResultVo;
import com.qf.springbootproject.websocket.WebSocketServer;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * 模拟微信支付回调接口
 */
@RestController
@RequestMapping("/callback")
public class wxCallBackController {
    @GetMapping("/get/{oid}")
    public ResultVo callback(@PathVariable("oid") String oid) throws IOException {
        WebSocketServer.sendMsg(oid, "1");
        return ResultVo.ok();
    }
}
